package com.lyf.emall.mapper;

import com.lyf.emall.bean.OrderItem;
import com.lyf.emall.bean.OrderList;
import com.lyf.emall.bean.OrderShipping;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Description:
 * @Author Lfy
 * @Date 2022/4/20-14:53
 */
@Mapper
public interface OrderMapper {

    /**
     * 向数据库中插入订单
     * @param orderList
     * @return
     */
    Integer insertOrderList(OrderList orderList);

    /**
     * 插入订单详情
     * @param orderItem
     * @return
     */
    Integer insertOrderItem(OrderItem orderItem);

    /**
     * 插入订单物流信息
     * @param orderShipping
     * @return
     */
    Integer insertOrderShipping(OrderShipping orderShipping);

    /**
     * 查询所有订单信息
     * @return
     */
    List<OrderList> queryAllOrder();

    /**
     * 修改订单表的物流信息
     * @param orderList
     * @return
     */
    Integer updateOrderShipping(OrderList orderList);

    /**
     * 修改订单表的备注
     * @param orderId
     * @param buyerMessage
     * @return
     */
    Integer updateOrderRemark(String orderId, String buyerMessage);

    /**
     * 修改订单的状态
     * @param orderList
     * @return
     */
    Integer updateOrderStatus(OrderList orderList);

    /**
     * 查询订单详情
     * @param orderId
     * @return
     */
    OrderItem queryOrderItemByOrderId(String orderId);

    /**
     * 查询订单物流信息
     * @param orderId
     * @return
     */
    OrderShipping queryOrderShippingByOrderId(String orderId);
}
